home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Newton Sample Code 1.2 / User Interface Guidelines / AdjustoButton-1 / AdjustoButton.README < prev    next >
Encoding:
Text File  |  1994-07-07  |  2.3 KB  |  76 lines  |  [TEXT/R*ch]

  1. This sample provides two user protos you can use for buttons that conform to
  2. the User Interface Guidelines.
  3.  
  4. The user protos are:
  5.  
  6. protoAdjustoButton - use for a stand alone button
  7.  
  8. protoAdjustoClusterButton - user for a cluster of buttons.
  9.  
  10. ...also included is protoResizeApp, a slight extension to protoApp that
  11. resizes the base view based on the screen size and max sizes.
  12.  
  13.  
  14.  
  15. protoAdjustoButton
  16. ------------------
  17.  
  18. You can use this wherever you would use a normal button. At runtime the button
  19. will adjust its size based on the text in the button. If you use SetValue
  20. to change the text slot, the button will resize to the new text.
  21.  
  22. Note that the size of the button is calculated relative to the top left
  23. as specified in the viewBounds.
  24.  
  25. The relevant slots and methods are:
  26.  
  27. text
  28.     The string to appear in the button (Must be provided)
  29.     
  30. viewBounds
  31.     The size of the button. Only the top and left values are used.
  32.     The viewBounds will be readjusted at viewSetupFormScript time.
  33.     You must provide a viewBounds.
  34.     
  35. textSpacer (optional)
  36.     The total space to leave on each side of the text of the button.
  37.     The default is 8 (4 pixels of white space on either side of the text)
  38.     
  39. buttonHeight (optional)
  40.     The height of the button. Currently set to 13 as per the User Interface
  41.     Guidelines
  42.  
  43. viewSetupFormScript
  44.     Defined by protoAdjustoButton. This will set the viewBounds to the
  45.     new value.   If you override the viewSetupFormScript, make sure you
  46.     call inherited:?viewSetupFormScript to change the size.
  47.     
  48. viewChangedScript
  49.     Defined by protoAdjustoButton to respond to a change in the text slot.
  50.     Does call the inherited value.
  51.     
  52.  
  53.  
  54. protoAdjustoClusterButton
  55. -------------------------
  56.  
  57. This proto is designed to be used inside an enclosing cluster view (a clView
  58. works fine). The first button is a cluster must have a viewBounds specified
  59. for it (the alternative is to provide a protoAdjustoFirstClusterButton).
  60.  
  61. The proto is based on protoAdjustoButton. The slots and methods are the
  62. same as for protoAdjustoButton except for:
  63.  
  64.     
  65. viewBounds
  66.     Set by the proto. You should override the viewBounds of the first button
  67.     in the cluster. Change the left value to 4.
  68.     
  69. viewJustify
  70.     Set by the proto to sibling justify the buttons.
  71.     
  72. viewChangedScript
  73.     This also sends a SyncChildren and Dirty to the parent of the
  74.     button so that all the buttons maintain the same relationship when a 
  75.     button width changes.
  76.